package cn.jeeweb.modules.web.labor.service.impl;

import cn.jeeweb.core.common.service.impl.CommonServiceImpl;
import cn.jeeweb.core.query.data.Page;
import cn.jeeweb.core.query.data.PageImpl;
import cn.jeeweb.core.query.data.Pageable;
import cn.jeeweb.core.query.data.Queryable;
import cn.jeeweb.core.query.parse.QueryToWrapper;
import cn.jeeweb.modules.web.labor.content.HuEmployAutoContent;
import cn.jeeweb.modules.web.labor.content.HuSignContent;
import cn.jeeweb.modules.web.labor.mapper.HuTrainSignMapper;
import cn.jeeweb.modules.web.labor.entity.HuTrainSign;
import cn.jeeweb.modules.web.labor.service.IHuTrainSignService;
import com.baomidou.mybatisplus.mapper.Wrapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**   
 * @Title: hu_train_sign
 * @Description: hu_train_sign
 * @author rql
 * @date 2018-02-07 16:08:19
 * @version V1.0   
 *
 */
@Transactional
@Service("huTrainSignService")
public class HuTrainSignServiceImpl  extends CommonServiceImpl<HuTrainSignMapper,HuTrainSign> implements  IHuTrainSignService {

    @Resource
    private HuTrainSignMapper huTrainSignMapper;

    public Page<HuSignContent> selectSignList(Integer state,Queryable queryable, Wrapper<HuSignContent> wrapper){
        QueryToWrapper<HuSignContent> queryToWrapper = new QueryToWrapper<HuSignContent>();
        queryToWrapper.parseCondition(wrapper, queryable);
        // 排序问题
        queryToWrapper.parseSort(wrapper, queryable);
        Pageable pageable = queryable.getPageable();
        com.baomidou.mybatisplus.plugins.Page<HuSignContent> content = new com.baomidou.mybatisplus.plugins.Page<HuSignContent>(
                pageable.getPageNumber(), pageable.getPageSize());
        List<HuSignContent> list=huTrainSignMapper.selectSignList(state,content);
        content.setRecords(list);
        return new PageImpl<HuSignContent>(content.getRecords(), queryable.getPageable(), content.getTotal());
    }

}
